package com.hckjsec.cloud.service.impl;

import java.util.List;

import com.hckjsec.cloud.domain.wechatView.WechatView;
import com.hckjsec.common.core.domain.AjaxResult;
import com.hckjsec.common.utils.ComUtil;
import com.hckjsec.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hckjsec.cloud.mapper.AppletsApplicantUserLogMapper;
import com.hckjsec.cloud.domain.AppletsApplicantUserLog;
import com.hckjsec.cloud.service.IAppletsApplicantUserLogService;

/**
 * 微信用户日志Service业务层处理
 * 
 * @author cyt
 * @date 2021-09-07
 */
@Service
public class AppletsApplicantUserLogServiceImpl implements IAppletsApplicantUserLogService 
{
    @Autowired
    private AppletsApplicantUserLogMapper appletsApplicantUserLogMapper;

    /**
     * 查询微信用户日志
     * 
     * @param openid 微信用户日志ID
     * @return 微信用户日志
     */
    @Override
    public AppletsApplicantUserLog selectAppletsApplicantUserLogById(String openid)
    {
        return appletsApplicantUserLogMapper.selectAppletsApplicantUserLogById(openid);
    }

    /**
     * 查询微信用户日志列表
     * 
     * @param appletsApplicantUserLog 微信用户日志
     * @return 微信用户日志
     */
    @Override
    public List<AppletsApplicantUserLog> selectAppletsApplicantUserLogList(AppletsApplicantUserLog appletsApplicantUserLog)
    {
        return appletsApplicantUserLogMapper.selectAppletsApplicantUserLogList(appletsApplicantUserLog);
    }

    /**
     * 新增微信用户日志
     * 
     * @param appletsApplicantUserLog 微信用户日志
     * @return 结果
     */
    @Override
    public int insertAppletsApplicantUserLog(AppletsApplicantUserLog appletsApplicantUserLog)
    {
        return appletsApplicantUserLogMapper.insertAppletsApplicantUserLog(appletsApplicantUserLog);
    }

    /**
     * 修改微信用户日志
     * 
     * @param appletsApplicantUserLog 微信用户日志
     * @return 结果
     */
    @Override
    public int updateAppletsApplicantUserLog(AppletsApplicantUserLog appletsApplicantUserLog)
    {
        return appletsApplicantUserLogMapper.updateAppletsApplicantUserLog(appletsApplicantUserLog);
    }

    /**
     * 批量删除微信用户日志
     * 
     * @param openids 需要删除的微信用户日志ID
     * @return 结果
     */
    @Override
    public int deleteAppletsApplicantUserLogByIds(String[] openids)
    {
        return appletsApplicantUserLogMapper.deleteAppletsApplicantUserLogByIds(openids);
    }

    /**
     * 删除微信用户日志信息
     * 
     * @param openid 微信用户日志ID
     * @return 结果
     */
    @Override
    public int deleteAppletsApplicantUserLogById(String openid)
    {
        return appletsApplicantUserLogMapper.deleteAppletsApplicantUserLogById(openid);
    }

    /**
     * 添加用户日志
     *
     * @param openid 微信用户日志ID
     * @return 结果
     */
    @Override
    public void insertLong(String openid,String contenr)
    {
        if(!"".equals(StringUtils.isHcNull(openid,""))){
            AppletsApplicantUserLog appletsApplicantUserLog = new AppletsApplicantUserLog();
            appletsApplicantUserLog.setOpenid(openid);
            appletsApplicantUserLog.setContent(contenr);
            appletsApplicantUserLogMapper.insertAppletsApplicantUserLog(appletsApplicantUserLog);
        }
    }
}
